import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[]args){
        Scanner cin = new Scanner(System.in);
        String s = cin.nextLine();
        cin.close();
        int []a = new int[10];
        final int []pos = {0,2,3,4,6,7,8,9,10,12};
        //0-670-82162-4
        int sum = 0;
        for(int i=0; i!=10; i++){
            a[i] = s.charAt(pos[i])-'0';
            sum += a[i]*(i+1);
        }
        sum = ( sum-a[9]*(9+1) )%11;
        //System.out.println(sum);
        if(sum == a[9] || (sum == 10 && s.charAt(pos[9])=='X')){
            System.out.println("Right");
            return;
        }
        char ed = sum<=9 ? (char)(sum+'0') : 'X';
        System.out.println(s.substring(0,s.length()-1)+ed);
    }
}